<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>AringFileSelction</title>
  <link rel="stylesheet" href="./assets/style/demo.css">
  <link rel="stylesheet" href="./assets/font-icon/iconfont.css">
</head>
<body>
  <div class="file-wrap">
    <div id="aringFileSel"></div>
  </div>
  <script src="./index.js"></script>
  <script>
    const list = [
      {
        type: 'png',
        name: '图片',
        fileId: 1
      },
      {
        type: 'mp3',
        name: '音乐',
        fileId: 2
      },
      {
        type: 'mp4',
        name: '视频',
        fileId: 3
      },
      {
        type: 'txt',
        name: '文件',
        fileId: 4
      }
    ]
    const menu = [
      {
        name: '下载',
        onclick: (filesDOM, filesAttr) => {
          console.log(filesDOM, filesAttr)
        }
      },
      {
        name: '删除',
        onclick: (files) => {
          for (let i of files) {
            i.remove()
          }
        }
      },
      {
        name: '刷新',
        onclick: () => {
          demo.refresh(list)
        }
      }
    ]
    const demo = new ResourceManager(list, menu)
  </script>
</body>
</html>